package com.tzw.service.serviceImpl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.tzw.mapper.ModuleOfProductMapper;
import com.tzw.pojo.BasicCpjs;
import com.tzw.pojo.BasicZpxx;
import com.tzw.pojo.ModuleInfoVO;
import com.tzw.pojo.ModuleOfProduct;
import com.tzw.service.ModuleOfProductService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ModuleOfProductServiceImpl extends ServiceImpl<ModuleOfProductMapper, ModuleOfProduct> implements ModuleOfProductService {
    @Autowired
    private ModuleInfoVO moduleInfoVO;
    @Override
    public ModuleInfoVO modelJoinInfo(String id) {
        List<BasicCpjs> basicCpjs = this.baseMapper.modelJoinInfo(id);
        ModuleOfProduct module = this.baseMapper.selectById(id);
        for(BasicCpjs cpjs:basicCpjs){
            String description = cpjs.getDetailedDescription();
            cpjs.setDetailedDescription(description.replaceAll("&","</br>"));
        }
        moduleInfoVO.setList(basicCpjs);
        moduleInfoVO.setModule(module);
        return moduleInfoVO;
    }
}
